package com.example.java250806_spring_ioc_demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logger")
public class LoggerController {
    private Logger logger = LoggerFactory.getLogger(LoggerController.class);
    @RequestMapping("/print")
    public String print(){
        //System.out.println("打印日志");
//        logger.info("打印日志");
        logger.trace("我是trace日志");
        logger.debug("我是debug日志");
        logger.info("我是info日志");
        logger.warn("我是warn日志");
        logger.error("我是error日志");

        return "1";
    }
}






































